home *** CD-ROM | disk | FTP | other *** search
- #include "bbs.h"
-
- void ReceivePlayPen(void)
- {
- BPTR FLock;
- struct FileInfoBlock *Fib;
- char *s;
- int cnt = 0;
- Online_NFiles=0;
- TBT=0;
- strcpy(RecFileNames,"");
- if(Sopt->RamPen[0]!=NULL) sprintf(GSTR1,"%s/",Sopt->RamPen);
- else sprintf(GSTR1,"%sPlaypen",NodeStr);
-
- if((Fib = (struct FileInfoBlock *)AllocDosObject(DOS_FIB,NULL)) == NL) {
- MyError(0); return;
- }
- /* lock the directory (Playpen or RamPen */
- if((FLock = Lock(GSTR1,ACCESS_READ)) == 0) {
- MyError(8); goto fx;
- }
-
- if((Examine(FLock,Fib)) == 0) {
- MyError(6); goto fx;
- }
-
- if(Fib->fib_DirEntryType > 0) { /* make sure we locked a directory */
- while(ExNext(FLock,Fib)) {
- if(Fib->fib_DirEntryType < 0) { /* found a file */
- /* or we can change to &Fib->fib_FileName[0] */
- if(strlen(Fib->fib_FileName) == 0) { /* check for filename > 0 length */
- ErrorLog("(cpp - 631) Strlen\n");
- goto fx;
- }
-
- cnt = 0;
- s = Fib->fib_FileName;
- while(*s && cnt < 30) { /* check for valid file name */
- if(*s == ' ') { /* check for spaces at beginning of filename */
- goto fx;
- }
- if(*s == '/') {
- goto fx;
- }
- if(!(isascii((int) *s))) {
- goto fx;
- }
- cnt++;
- s++;
- }
- Online_NFiles++; TBT +=Fib->fib_Size;
- strcat(RecFileNames,Fib->fib_FileName); strcat(RecFileNames," ");
-
- } /* end if(Fib->fib_DirEntryType < 0) */
- } /* end while(ExNext(FLock,Fib)) */
- } /* end if(Fib->fib_DirEntryType > 0) */
-
- fx: ;
- if(FLock) UnLock(FLock);
- if(Fib) FreeDosObject(DOS_FIB,Fib);
- }
-